Array.prototype.myMap = function(callback){
  let retArr = []
  for(let i = 0,len = this.length;i < len;i++){
     retArr.push(callback && callback(this[i],i,this)) 
  }
  return retArr
}


console.log([1,2,3].myMap())